//package top.xana.acg.anime.ui.view
//
//import android.content.Context
//import android.util.AttributeSet
//import androidx.recyclerview.widget.GridLayoutManager
//import androidx.recyclerview.widget.LinearLayoutManager
//import androidx.recyclerview.widget.RecyclerView
//
///**
// * Created by xana on 2022/1/13
// * Describe: hello world
// */
//class SelfRecyclerView(context: Context, attrs: AttributeSet?, defStyleAttr: Int) :
//    RecyclerView(context, attrs, defStyleAttr) {
//    var mListener: LoadMoreListener? = null
//
//    constructor(context: Context, attrs: AttributeSet?): this(context, attrs, 0)
//    constructor(context: Context): this(context, null)
//
//
//    fun setLoadMoreLister(listener: LoadMoreListener){
//        mListener = listener
//    }
//
//    override fun onScrolled(dx: Int, dy: Int) {
//        super.onScrolled(dx, dy)
//        val manager = layoutManager
//        if (manager is LinearLayoutManager || manager is GridLayoutManager) {
//            val flag =
//                adapter!!.itemCount - 1 == (manager as LinearLayoutManager).findLastCompletelyVisibleItemPosition()
//            if (flag) {
//                mListener?.loadMore()
//            }
//        }
//    }
//
//
//    interface LoadMoreListener {
//        fun loadMore()
//    }
//}